package zzxkj.blog.search.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import zzxkj.blog.pojo.User;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zzxkj
 */
@Data
@Document(indexName = "blog",type = "blog",createIndex=true)
public class SearchDocument implements Serializable {
    @Id
    private Long id;
    @Field(type = FieldType.Text, searchAnalyzer="ik_smart", analyzer = "ik_max_word")
    private String title;
    @Field(type = FieldType.Text,searchAnalyzer = "ik_smart",analyzer = "ik_max_word")
    private String description;
    @Field(type = FieldType.Text)
    private String firstPicture;
    @Field(type = FieldType.Integer)
    private Integer views;
    @Field(type = FieldType.Date)
    private Date updateTime;

    //Type
    @Field(type = FieldType.Text)
    private String typeName;
    //User
    @Field(type = FieldType.Text)
    private String nickname;
    @Field(type = FieldType.Text)
    private String avatar;
}
